const path = require('path');
module.exports = {
  devtool: 'source-map',
  entry: {
    login: [path.resolve(__dirname, "src/login.js")],
    index: [path.resolve(__dirname, "src/index.js")],
    demo: [path.resolve(__dirname, "src/demo.js")],
    userMgr: [path.resolve(__dirname, "src/userMgr/student/graduate.jsx"), 
              path.resolve(__dirname, "src/userMgr/student/undergraduate.jsx")],
  },
  output: {
    path: path.resolve(__dirname, 'public'),
    filename: '[name].js'
  },
  module: {
    rules: [
      {
        test: /\.jsx?$/,
        loader: 'babel-loader',
        exclude: '/node_modules/',
        query: {
          presets: ['es2015', 'react']
        }
      },
      {
        test: /\.css$/,
        loader: 'style-loader!css-loader',
        exclude: '/node_modules/',
      },
      {
        test: /\.(png|jpg|gif|jpeg)$/,
        loader: 'url-loader'
      }
    ]
  }
}